GtkSearchBar: Fix automatic entry connection
authorBastien Nocera <hadess@hadess.net>
Mon, 1 Jul 2013 17:46:13 +0000 (19:46 +0200)
committerBastien Nocera <hadess@hadess.net>
Thu, 4 Jul 2013 10:52:30 +0000 (12:52 +0200)
Adding an entry to the search bar didn't automatically connect
the signals as expected as the code was in the wrong branch.

https://bugzilla.gnome.org/show_bug.cgi?id=703406

gtk/gtksearchbar.c

index 57c493078940d60b84cef7f5baed087cba2b1382..67a5eaa1c1bfdafd6e8c4a86a469910ca0061bea 100644 (file)
@@ -293,16 +293,16 @@ gtk_search_bar_add (GtkContainer *container,
   if (bar->priv->box_center == NULL)
     {
       GTK_CONTAINER_CLASS (gtk_search_bar_parent_class)->add (container, child);
+    }
+  else
+    {
+      gtk_container_add (GTK_CONTAINER (bar->priv->box_center), child);
       /* If an entry is the only child, save the developer a couple of
        * lines of code
        */
       if (GTK_IS_ENTRY (child))
         gtk_search_bar_connect_entry (bar, GTK_ENTRY (child));
     }
-  else
-    {
-      gtk_container_add (GTK_CONTAINER (bar->priv->box_center), child);
-    }
 }
 
 static void